<%--
  Created by IntelliJ IDEA.
  User: HP
  Date: 2023/10/7
  Time: 11:22
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>商品列表展示</title>
    <%--1. 引入jquery--%>
    <script src="webjars/jquery/3.6.4/jquery.min.js"></script>
    <%--2. 引入bootstrap的css样式--%>
    <link rel="stylesheet" href="webjars/bootstrap/3.4.1/css/bootstrap.min.css">
    <%--3. 引入bootstrap的js库--%>
    <script src="webjars/bootstrap/3.4.1/js/bootstrap.min.js"></script>
    <style>
        .panel-title{
            padding:10px 0px;
            font-size: 20px;
        }
        .table{
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <h3 class="panel-title">
                    商品列表展示
                </h3>
            </div>
            <table class="table table-hover table-striped">
                <tr>
                    <td>商品ID</td>
                    <td>商品名称</td>
                    <td>商品价格</td>
                    <td>库存量</td>
                    <td>是否购买</td>
                </tr>
                <c:forEach items="${products}" var="p">
                <tr>
                    <td>${p.pid}</td>
                    <td>${p.pname}</td>
                    <td>${p.price}</td>
                    <td>${p.quantity}</td>
                    <td>
                        <a href="/cart?cmd=addCart&pid=${p.pid}" class="btn btn-warning btn-sm">是否挑选</a>
                    </td>
                </tr>
                </c:forEach>
            </table>
            <div class="panel-footer text-right">
               商品列表展示 2023.
            </div>
        </div>
    </div>
</body>
</html>
